home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Libraries / GUSI 1.4.1 / GUSI / GUSISIOW.cp < prev    next >
Encoding:
Text File  |  1994-02-25  |  1.5 KB  |  95 lines  |  [TEXT/MPS ]

  1. /*********************************************************************
  2. Project    :    GUSI                -    Grand Unified Socket Interface
  3. File        :    GUSISIOW.cp        -    Update & activate SIOW window
  4. Author    :    Matthias Neeracher
  5. Language    :    MPW C/C++
  6.  
  7. $Log: GUSISIOW.cp,v $
  8. Revision 1.1  1994/02/25  02:30:26  neeri
  9. Initial revision
  10.  
  11. Revision 0.2  1992/12/18  00:00:00  neeri
  12. _DoActivate incorrectly depends on current port
  13.  
  14. Revision 0.1  1992/04/27  00:00:00  neeri
  15. C++ version
  16.  
  17. *********************************************************************/
  18.  
  19. #include "GUSI_P.h"
  20.  
  21. #include <Events.h>
  22. #include <Windows.h>
  23.  
  24. static void GUSISIOWActivate(EventRecord * ev);
  25. static void GUSISIOWUpdate(EventRecord * ev);
  26. static void GUSISIOWSusRes(EventRecord * ev);
  27.  
  28. GUSIEvtHandler    GUSISIOWEvents[]    =    {
  29.     nil,
  30.     
  31.     nil,
  32.     nil,
  33.     nil,
  34.     nil,
  35.     
  36.     nil,
  37.     GUSISIOWUpdate,
  38.     nil,
  39.     GUSISIOWActivate,
  40.     
  41.     nil,
  42.     nil,
  43.     nil,
  44.     nil,
  45.     
  46.     nil,
  47.     nil,
  48.     GUSISIOWSusRes,
  49.     nil,
  50.     
  51.     nil,
  52.     nil,
  53.     nil,
  54.     nil,
  55.     
  56.     nil,
  57.     nil,
  58.     nil,
  59. };
  60.  
  61. extern "C" void _DoActivate(WindowPtr win, int activate);
  62. extern "C" void _DoUpdate(WindowPtr win);
  63.  
  64. static void GUSISIOWActivate(EventRecord * ev)
  65. {
  66.     GrafPtr port;
  67.     
  68.     GetPort(&port);
  69.     
  70.     if ((WindowPtr) ev->message)
  71.         SetPort((WindowPtr) ev->message);
  72.         
  73.     _DoActivate((WindowPtr) ev->message, ev->modifiers & activeFlag);
  74.     
  75.     SetPort(port);
  76. }
  77.  
  78. static void GUSISIOWUpdate(EventRecord * ev)
  79. {
  80.     _DoUpdate((WindowPtr) ev->message);
  81. }
  82.  
  83. static void GUSISIOWSusRes(EventRecord * ev)
  84. {    GrafPtr port;
  85.     
  86.     GetPort(&port);
  87.     SetPort(FrontWindow());
  88.         
  89.     _DoActivate(FrontWindow(), (int) ev->message & 1);
  90.     
  91.     SetPort(port);
  92. }
  93.  
  94.  
  95.